package com.card.hwatt.entity;

import java.util.UUID;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.OneToOne;
import javax.persistence.Table;

import org.hibernate.annotations.GenericGenerator;
import org.hibernate.annotations.Type;

/**
 * 单位
 * 
 * @author Administrator
 * 
 */
@Entity
@Table(name = "T_Company")
public class Company {

	@Id
	@GeneratedValue(generator = "generator")
	@GenericGenerator(name = "generator", strategy = "assigned")
	@Column(name = "CompanyID", length = 36)
	@Type(type = "uuid-char")
	public UUID id;

	/**
	 * 部门
	 */
	@OneToOne(cascade = {}, fetch = FetchType.EAGER)
	@JoinColumn(name = "DepartmentID")
	public Department department;

	/**
	 * 每日工时
	 */
	@Column(name = "`Quantity`", nullable = false)
	public int quantity;
}
